//package com.kfh.ybracelet.widget;
//
//import android.graphics.Bitmap;
//import android.os.Bundle;
//import android.support.v4.view.ViewPager;
//import android.view.View;
//
//import com.kfh.ybracelet.R;
//import com.kfh.ybracelet.adapter.ProviewAdapter;
//import com.kfh.ybracelet.base.BaseActivity;
//import com.kfh.ybracelet.bean.BitmapDetail;
//import com.kfh.ybracelet.photoview.PhotoView;
//import com.kfh.ybracelet.utils.CommonUtils;
//import com.nostra13.universalimageloader.core.DisplayImageOptions;
//import com.nostra13.universalimageloader.core.ImageLoader;
//import com.nostra13.universalimageloader.core.assist.ImageScaleType;
//import com.nostra13.universalimageloader.core.display.SimpleBitmapDisplayer;
//
//import java.util.ArrayList;
//import java.util.List;
//
//
///**
// * Created by Aaron on 15/8/18.
// */
//public class PreviewPhotoActivity extends BaseActivity {
//
//    private DisplayImageOptions options;
//
//    @Override
//    protected void onCreate(Bundle savedInstanceState) {
//        super.onCreate(savedInstanceState);
//
//        setContentView(R.layout.widget_photo_view);
//
//        //当前预览图片的角标
//        int position = getIntent().getIntExtra("position", 0);
//
//        //本地图片的集合
//        List<BitmapDetail> details = (List<BitmapDetail>) getIntent().getSerializableExtra("lists");
//
//        //网络图片的集合
//        ArrayList<String> preUrlPhotos = getIntent().getStringArrayListExtra("preUrlPhotos");
//
//        List<PhotoView> photoviews = new ArrayList<PhotoView>();
//
//        if (details != null) { //本地图片的预览
//
//            for (BitmapDetail b : details) {
//
//                PhotoView photoView = new PhotoView(this);
//                photoView.setImageBitmap(CommonUtils.getBitmapFromPath(b.mPath));
//                photoviews.add(photoView);
//
//            }
//
//        }else if (preUrlPhotos != null) {//网络图片的预览
//
//            options = new DisplayImageOptions.Builder()
//                    .showImageOnLoading(R.drawable.icon_loading_big_default)
//                    .showImageForEmptyUri(R.drawable.icon_default)
//                    .showImageOnFail(R.drawable.icon_default)
//                    .resetViewBeforeLoading(true)
//                    .cacheOnDisk(true).cacheInMemory(true)
//                    .cacheOnDisc(true).imageScaleType(ImageScaleType.EXACTLY)
//                    .bitmapConfig(Bitmap.Config.RGB_565)
//                    .considerExifParams(true)
//                    .displayer(new SimpleBitmapDisplayer()).build();
////
//            for (String b : preUrlPhotos) {
//
//                PhotoView photoView = new PhotoView(this);
//                // 朋友圈大图  + _Tb
//                ImageLoader.getInstance().displayImage(b, photoView, options);
//                photoviews.add(photoView);
//
//            }
//
//        }
//
//        ProviewAdapter proviewAdapter = new ProviewAdapter(photoviews, this);
//
//        ViewPager vp_pics = (ViewPager) findViewById(R.id.vp_pics);
//
//        vp_pics.setAdapter(proviewAdapter);
//        vp_pics.setCurrentItem(position);
//
//    }
//    public void onResume() {
//        super.onResume();
////        MobclickAgent.onResume(this);       //统计时长
//    }
//    public void onPause() {
//        super.onPause();
////        MobclickAgent.onPause(this);
//    }
//    @Override
//    public void widgetClick(View v) {
//
//    }
//}